package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;
/**
 * @author 何惠民
 */
public class Test {

    public static void main(String[] args) throws IOException {
        FileOutputStream out = new FileOutputStream("note.txt",true);
        Scanner s = new Scanner(System.in);
        String str = "";
        System.out.println("开始输入内容，单独输入exit退出");
        //equalsIgnoreCase()忽略大小写对比
        while(!"exit".equalsIgnoreCase(str=s.next())){
            out.write(str.getBytes(StandardCharsets.UTF_8));
            out.write("\n".getBytes(StandardCharsets.UTF_8));
        }
        System.out.println("结束");
    }
}
